<template>
    <el-dialog title="结账状态" :visible.sync="dialogFormVisible" :close-on-click-modal="false"
        :close-on-press-escape="false" @close="cancel">
        <el-form :model="checkForm" label-width="110px" label-position="right">
            <el-form-item label="婚庆结账">
                <el-radio-group v-model="checkForm.wedding_is_checkout">
                    <el-radio label="0">是</el-radio>
                    <el-radio label="1">否</el-radio>
                </el-radio-group>
            </el-form-item>
            <el-form-item label="工作室结账">
                <el-radio-group v-model="checkForm.studio_is_checkout">
                    <el-radio label="0">是</el-radio>
                    <el-radio label="1">否</el-radio>
                </el-radio-group>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="cancel">取消</el-button>
            <el-button type="primary" @click="submit">确定</el-button>
        </div>
    </el-dialog>
</template>
<script>
export default {
    data() {
        return {
            dialogFormVisible: false,
            checkForm: {
                wedding_is_checkout: '0',
                studio_is_checkout: '0'
            },
        }
    },
    methods: {
        cancel() {
            this.dialogFormVisible = false
        },
        openDialog(item) {
            console.log('xxxxx', item);

            this.checkForm = {
                ...item,
                wedding_is_checkout: item.wedding_is_checkout.toString(),
                studio_is_checkout: item.studio_is_checkout.toString()
            };
            this.dialogFormVisible = true
        },
        submit() {
            this.$api.queryCanCheckout(this.checkForm).then(res => {
                this.$message.success('操作成功')
                this.dialogFormVisible = false
                this.$parent.restForm()
            }).catch(err => {
                this.$message.error(err.message)
            })
        }
    },
    mounted() {
    }
}
</script>
<style lang="less" scoped>
.title {
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.title::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 20px;
    background-color: #409eff;
    margin-right: 5px;
}

.uploadDiv {
    width: 120px;
    height: 120px;
    border: 1px dashed #C0C4CC;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;

    i {
        font-size: 25px;
        color: #909399;
    }
}

.uploadDiv:hover {
    border-color: #409eff;

    i {
        color: #409eff;
    }
}

/deep/.el-form-item {
    margin-bottom: 15px;
}

/deep/.el-input {
    width: 250px;
}

/deep/.el-textarea {
    width: 250px;
}
</style>